<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta content="telephone=no" name="format-detection" />
    <!-- 留作将来统一添加 -->
    <TEMPLATE>${TEMPLATE}</TEMPLATE>
    <title>课程详情</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css">
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <link rel="stylesheet" type="text/css" href="../../css/data-flex.min.css">
    <style type="text/css">
        body {
            background: rgba(90, 194, 255, 1);
        }
        
        .item {
            position: relative;
            height:200px;
            background:rgba(255,255,255,1);
            box-shadow:0px 5px 10px 0px rgba(15,115,174,0.41);
            border-radius:8px;
            margin: 15px;
            overflow: hidden;
        }
        
        .content {
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 60px;
            padding: 20px 15px 0 15px;
            background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
        }

        .row {
            height: 20px;
        }
        
        .txt {
            font-size: 16px;
            font-weight: 500;
            color: rgba(255, 255, 255, 1);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .icon {
            width: 20px;
            height: 20px;
            min-width: 20px;
            margin-left: 25px;
        }
        
        .progress {
            min-width: 40px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            text-align: right;
            margin-left: 25px;
        }
        
        .progress-outer {
            height: 4px;
            background: rgba(234, 247, 255, 1);
            border-radius: 2px;
            margin-top: 5px;
        }
        
        .progress-inner {
            height: 4px;
            background: rgba(90, 194, 255, 1);
            border-radius: 2px;
        }
    </style>
</head>

<body>
    <div class="vueApp" v-cloak>
        <div class="item" v-for="item,index in listData">
            <img :src="item.img " alt="">
            <div class="content">
                <div v-show="item.type === 1">
                    <div class="row" data-flex="main:justify cross:center">
                        <div class="txt" data-flex-box="1 ">{{ item.txt }}</div>
                        <img class="icon" src="../../image/ui/download.png " alt="">
                    </div>
                </div>
                <div v-show="item.type === 2">
                    <div class="row" data-flex="main:justify cross:center">
                        <div class="txt " data-flex-box="1 ">{{ item.txt }}</div>
                        <div class="progress ">{{ item.progress }}%</div>
                    </div>
                    <div class="progress-outer ">
                        <div class="progress-inner " :style="{width: item.progress + '%'} "></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js "></script>
<script type="text/javascript" src="../../script/service/service-tool.js "></script>
<script type="text/javascript" src="../../script/service/service-app.js "></script>
<script type="text/javascript" src="../../script/service/service-user.js "></script>
<script type="text/javascript" src="../../script/service/service-logic.js "></script>
<script type="text/javascript" src="../../script/jquery.min.js "></script>
<script type="text/javascript" src="../../script/vue.min.js "></script>
<script type="text/javascript">
    // html 的引号一律为双引号(" "),js 为单引号('')
    var USER, $S, vm;
    apiready = function() {
        $S = SERVICE();
        USER = USER();
        console.log(JSON.stringify(api.pageParam) + '=====pageParam');

        fnInit();
    };
    
    // 初始化
    function fnInit() {
        vm = new Vue({
            el: '.vueApp',
            data: {
                listData: [
                    {
                        type: 1,
                        img: '../../image/ui/demo.png',
                        txt: '来认识我的家庭成员吧来认识我的家庭成员吧',
                        progress: 76.2
                    }, {
                        type: 2,
                        img: '../../image/ui/demo.png',
                        txt: '来认识我的家庭成员吧',
                        progress: 30
                    }, {
                        type: 1,
                        img: '../../image/ui/demo.png',
                        txt: '来认识我的家庭成员吧来认识我的家庭成员吧',
                        progress: 25
                    }, {
                        type: 2,
                        img: '../../image/ui/demo.png',
                        txt: '来认识我的家庭成员吧',
                        progress: 38
                    }
                ]
            }
        });
    }
</script>

</html>